#include "led_flow_task.h"
#include "tim.h"
#include "cmsis_os.h"
#include "main.h"
#include "gpio.h"
#include "freertos.h"

int LED_flag=1;
	
	
void LED_R_Task(void const * argument)
{
	uint32_t a=0;
	HAL_TIM_PWM_Start(&htim5,TIM_CHANNEL_3);
	while(1)
	{
		LED_flag=-LED_flag;
		
		for(a=0;a<1000;a+=2)
		{
			__HAL_TIM_SET_COMPARE(&htim5,TIM_CHANNEL_3,a);
			osDelay(2);
		}
			for(a=1000;a>0;a-=2)
		{
			__HAL_TIM_SET_COMPARE(&htim5,TIM_CHANNEL_3,a);
			osDelay(2);
		}
	}
}
